<template>
  <div id="app" class="container">
   
    <global-header :user="currentUser"/>
    <router-view></router-view>
  </div>
</template>

<script lang="ts">
import 'bootstrap/dist/css/bootstrap.min.css'
import {defineComponent,computed,onMounted} from 'vue'

import GlobalHeader  from './components/GlobalHeader/GlobalHeader.vue'
import {useStore} from 'vuex'
import {GlobalDataProps} from '@/store/index'
import axios from '@/api/request'

/* 使用store，获取user数据,并采用持久化 */
export default defineComponent({
  name: 'App',
  components: {
    GlobalHeader,
  },
  setup() {
    
    const store = useStore<GlobalDataProps>()
    const currentUser = computed(() => {
      return store.state.user
    })
 /*    if (!currentUser.value.isLogin) {
      router.push('/login')
    } */
    onMounted(() => {
     console.log('');
     
    })
    return {
      currentUser
    }
  }
})
</script>

<style>

</style>
